package com.bnzj.core.config;

import java.io.File;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public abstract class CoreProperties {

    private boolean developerMode = false;
    private long maxLogLines = 20;
    private String version;
    private String secretkey;
    private Security security;
    private FileServer fileServer;
    private String fileSavePath;//文件保存路径
    
    public void setFileSavePath(String fileSavePath) {
        File file = new File(fileSavePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        fileSavePath = file.getAbsolutePath() + File.separator;
        this.fileSavePath = fileSavePath;
    }

    @Getter
    @Setter
    public static class FileServer {
        private boolean enabled;
        private String url;
        private String host;
        private Integer port;
    }

    @Getter
    @Setter
    public static class Security {
        private String ignored;//不需要进行权限管理的资源
        private String anonymous;//可匿名访问的资源
        private String localServerUrl;//local服务url
        private Cas cas;
    }

    @Getter
    @Setter
    public static class Cas {
        private String serverUrl;//cas服务url
        private String serverLoginUrl;//cas服务登录url
        private String serverLogoutUrl;//cas服务登出url
        private String clientUrl;//client url
        private String clientLoginPath;//client服务登出url
        private String clientLogoutPath;//client服务登出url
        private String proxyReceptorPath;//client代理接收url
    }
}
